package com.haha.keymap;

import javax.swing.*;
import java.awt.*;

public class SkillConfig {

    private Point point1;
    private Point point2;
    private Color color1;
    private Color color2;
    private String skillName;
    private String keyBinding;

    // UI组件引用
    private int currentPoint = 0; // 1 for point1, 2 for point2
    private JLabel point1PosLabel;
    private JLabel point2PosLabel;
    private JPanel point1ColorPanel;
    private JPanel point2ColorPanel;

    public Point getPoint1() {
        return point1;
    }

    public void setPoint1(Point point1) {
        this.point1 = point1;
    }

    public Point getPoint2() {
        return point2;
    }

    public void setPoint2(Point point2) {
        this.point2 = point2;
    }

    public Color getColor1() {
        return color1;
    }

    public void setColor1(Color color1) {
        this.color1 = color1;
    }

    public Color getColor2() {
        return color2;
    }

    public void setColor2(Color color2) {
        this.color2 = color2;
    }

    public String getSkillName() {
        return skillName;
    }

    public void setSkillName(String skillName) {
        this.skillName = skillName;
    }

    public String getKeyBinding() {
        return keyBinding;
    }

    public void setKeyBinding(String keyBinding) {
        this.keyBinding = keyBinding;
    }

    public int getCurrentPoint() {
        return currentPoint;
    }

    public void setCurrentPoint(int currentPoint) {
        this.currentPoint = currentPoint;
    }

    public void setPoint1PosLabel(JLabel point1PosLabel) {
        this.point1PosLabel = point1PosLabel;
    }

    public void setPoint2PosLabel(JLabel point2PosLabel) {
        this.point2PosLabel = point2PosLabel;
    }

    public void setPoint1ColorPanel(JPanel point1ColorPanel) {
        this.point1ColorPanel = point1ColorPanel;
    }

    public void setPoint2ColorPanel(JPanel point2ColorPanel) {
        this.point2ColorPanel = point2ColorPanel;
    }

    public JLabel getPoint1PosLabel() {
        return point1PosLabel;
    }

    public JLabel getPoint2PosLabel() {
        return point2PosLabel;
    }

    public JPanel getPoint1ColorPanel() {
        return point1ColorPanel;
    }

    public JPanel getPoint2ColorPanel() {
        return point2ColorPanel;
    }

    @Override
    public String toString() {
        if (skillName != null && !skillName.isEmpty()) {
            return skillName + " (" + keyBinding + ")";
        } else if (point1 != null && point2 != null) {
            return "未命名技能 (" + point1.x + "," + point1.y + "), (" + point2.x + "," + point2.y + ")";
        }
        return "新技能配置";
    }

}
